<template>
  <div>
    <button @click="openDialog">fdsa</button>
    <yfu-dialog ref="yfuDialogDemo" :dialogParam="dialogParam" v-on:dialogOpenBefore="dialogOpenBefore" v-on:dialogCloseBefore="dialogCloseBefore">
    <div>dfsa<h3>fdasd</h3></div>
  </yfu-dialog>
  </div>
</template>
<script type="text/javascript">
  import yfuDialog from '@/components/common/yfuDialog.vue'
  export default {
    components: {
      'yfu-dialog': yfuDialog
    },
    methods: {
      openDialog () {
        this.$refs.yfuDialogDemo.openDialog()
      },
      // DIALOG 打开时执行方法
      dialogOpenBefore () {
        console.log('before')
      },
      closeDialog () {
        this.$refs.yfuDialogDemo.closeDialog()
      },
      // DIALOG 点击保存时 执行方法/同时关闭DIALOG
      dialogCloseBefore () {
        console.log('close')
        this.closeDialog()
      }
    },
    data () {
      return {
        dialogParam: {
          title: '标题',
          width: '30%',
          showFooter: true
        }
      }
    }
  }
</script>
<style>
</style>
